package com.dao.impl;

import com.dao.IRegisterDAO;
import com.pojo.SUser;
import com.utils.JdbcUtils;

public class RegisterDAOImpl implements IRegisterDAO {
    /*判断用户名是否存在*/
    @Override
    public SUser selectInfo(String name) {
        return JdbcUtils.queryOne( SUser.class,"select * from s_user where username=?", name);
    }
  /* 注册成功添加用户*/
    @Override
    public void insertUser(SUser sUser) {
        JdbcUtils.update("insert into s_user (id,username,password,type,userimg) values(?,?,?,?,?)",
                sUser.getId(),sUser.getUsername(),sUser.getPassword(),sUser.getType(),sUser.getUserimg());
    }
}
